################################################################################################################## # # GraphRep FILE OF Industrial_Business_Process_Management_ADOxx15-v0.3.0 Application Library # # This File contains the GraphRep of Class 'Chart' # ########################## GENERAL FILE INFOS #################################################################### # # APPLIES Industrial Business Process Management Toolkit V:1.0 # FILE VERSION: 1.0 # AUTHOR: NEF (BOC AM) # ############################### File History ##################################################################### # # [NEF, 09.11.2017] # - initial version for Industrial Business Process Management Toolkit V:1.0 # ################################################################################################################## GRAPHREP SHADOW off AVAL sObserve:"Observe" IF (sObserve="Buffer") { AVAL sFirstA:"RequiredQuantityArray" AVAL sSecondA:"AvailableQuantityArray" AVAL sCapacity:"Capacity" SET nCapacity:(VAL sCapacity) #show-curve flags AVAL bShowFirstCurve:"Show required quantity" AVAL bShowSecondCurve:"Show available quantity" AVAL bShowThirdCurve:"Show capacity" #Legend text SET sFirstCurveText:"Required" SET sSecondCurveText:"Available" SET sThirdCurveText:"Capacity" } IF (sObserve="Station") { AVAL sFirstA:"ExecutionTimeArray" SET sSecondA:"" SET sCapacity:"" #show-curve flags SET bShowFirstCurve:"yes" SET bShowSecondCurve:"no" SET bShowThirdCurve:"no" SET sFirstCurveText:"Execution\ntime" } SET nFirstA:(valarray(sFirstA)) SET nLFirstA: (LEN nFirstA) SET maxLenght:(10cm) SET indexZero:0 #indexZero is a marker to index always last 10 entries in array IF (nLFirstA > 10) { SET indexZero:(nLFirstA-10) } #---- Find Maximum Point for y axis------# SET nMaxFirstArray:0 FOR i from:0 to:(nLFirstA) { IF (nMaxFirstArray < nFirstA[i]) { SET nMaxFirstArray:(nFirstA[i]) } } SET nSecondA:(valarray(sSecondA)) SET nLSecondA: (LEN nSecondA) SET nMaxSecondArray:0 FOR i from:0 to:(nLSecondA) { IF (nMaxSecondArray nMaxSecondArray) { SET nMaxPoint:(nMaxFirstArray) } IF (nCapacity > nMaxPoint) { SET nMaxPoint:(nCapacity) } #----------------------------------------# #----------------------------------- draw white panel behind the chart -------------------------------------# PEN color:black w:1pt FILL color:white SET panel_x:(-0.8cm) SET panel_y:(0.8cm) SET panel_w:(maxLenght+3.5cm) SET panel_h:(maxLenght+1.5cm) RECTANGLE x:(panel_x) y:(panel_y) w:(panel_w) h:(-panel_h) #-----------------------------------------------------------------------------------------------------------# PEN color:black w:2pt #x axis LINE x1:(0cm) y1:(0cm) x2:(maxLenght) y2:(0cm) #y axis LINE x1:(0cm) y1:(0cm) x2:(0cm) y2:(-(maxLenght)) #legend FONT "Arial Black" h:8pt col:black TEXT "Legend" x:((panel_x+panel_w)-1.7cm) y:(-panel_h+1.3cm) w:l FONT "Arial" h:6pt col:black #if first curve is enabled, show its notation and text in the legend IF (bShowFirstCurve="yes") { PEN color:$378E96 w:0.06cm TEXT (sFirstCurveText) x:((panel_x+panel_w)-1.7cm) y:(-panel_h+2.0cm) w:l LINE x1:((panel_x+panel_w)-0.7cm) y1:(-panel_h+2.1cm) x2:((panel_x+panel_w)-0.3cm) y2:(-panel_h+2.1cm) } #if second curve is enabled, show its notation and text in the legend IF (bShowSecondCurve="yes") { PEN color:$50CE7C w:0.06cm TEXT (sSecondCurveText) x:((panel_x+panel_w)-1.7cm) y:(-panel_h+2.4cm) w:l LINE x1:((panel_x+panel_w)-0.7cm) y1:(-panel_h+2.5cm) x2:((panel_x+panel_w)-0.3cm) y2:(-panel_h+2.5cm) } #if third curve is enabled, show its notation and text in the legend IF (bShowThirdCurve="yes") { PEN color:$CC3D38 style:dash w:0.06cm TEXT (sThirdCurveText) x:((panel_x+panel_w)-1.7cm) y:(-panel_h+2.8cm) w:l LINE x1:((panel_x+panel_w)-0.7cm) y1:(-panel_h+2.9cm) x2:((panel_x+panel_w)-0.3cm) y2:(-panel_h+2.9cm) } #starting points of curves SET initialFX:0cm SET initialFY:(-(maxLenght)*((nFirstA[0])/nMaxPoint)) SET initialSX:0cm SET initialSY:(-(maxLenght)*((nSecondA[0])/nMaxPoint)) SET initialTX:0cm SET initialTY:0cm # calculate coordinates, draw points, lines and partitions FOR i from:(indexZero) to:(nLFirstA-1) { #y axis partitions PEN color:black w:1pt style:dash IF (bShowFirstCurve = "yes") { TEXT (STR (nFirstA[i])) x:(-0.2cm) y:(-(maxLenght)*((nFirstA[i])/nMaxPoint)) w:r #grid lines LINE x1:(0cm) y1:(-(maxLenght)*((nFirstA[i])/nMaxPoint)) x2:(1cm*(nLFirstA-indexZero)) y2:(-(maxLenght)*((nFirstA[i])/nMaxPoint)) } IF ((sObserve="Buffer") AND (bShowSecondCurve = "yes")) { TEXT (STR (nSecondA[i])) x:(-0.2cm) y:(-(maxLenght)*((nSecondA[i])/nMaxPoint)) w:r #grid lines LINE x1:(0cm) y1:(-(maxLenght)*((nSecondA[i])/nMaxPoint)) x2:(1cm*(nLFirstA-indexZero)) y2:(-(maxLenght)*((nSecondA[i])/nMaxPoint)) } #x axis partitions PEN color:black w:1pt style:dash TEXT (STR (i+1)) x:(1cm*((i-indexZero)+1)) y:(0.2cm) LINE x1:(1cm*((i-indexZero)+1)) y1:(0cm) x2:(1cm*((i-indexZero)+1)) y2:(-(maxLenght)) #First curve IF (bShowFirstCurve = "yes") { PEN color:$378E96 w:5pt LINE x1:(initialFX) y1:(initialFY) x2:(1cm*((i-indexZero)+1)) y2:(-(maxLenght)*((nFirstA[i])/nMaxPoint)) PEN color:$115599 w:7pt SET initialFX:(1cm*((i-indexZero)+1)) SET initialFY:(-(maxLenght)*((nFirstA[i])/nMaxPoint)) POINT x:(initialFX) y:(initialFY) } #Second curve IF (bShowSecondCurve = "yes") { PEN color:$50CE7C w:5pt LINE x1:(initialSX) y1:(initialSY) x2:(1cm*((i-indexZero)+1)) y2:(-(maxLenght)*((nSecondA[i])/nMaxPoint)) PEN color:$115599 w:7pt SET initialSX:(1cm*((i-indexZero)+1)) SET initialSY:(-(maxLenght)*((nSecondA[i])/nMaxPoint)) POINT x:(initialSX) y:(initialSY) } } #Capacity curve IF ((sObserve="Buffer") AND (bShowThirdCurve = "yes")) { PEN color:$CC3D38 w:5pt style:dash LINE x1:(0cm) y1:(-(maxLenght)*(nCapacity/nMaxPoint)) x2:(1cm*(nLFirstA-indexZero)) y2:(-(maxLenght)*(nCapacity/nMaxPoint)) TEXT (STR (nCapacity)) x:(-0.2cm) y:(-(maxLenght)*(nCapacity/nMaxPoint)) w:r }